#ifndef METANET_HANDLE_H
#define METANET_HANDLE_H

#include <stdint.h>

#define HANDLE_MASK 0xFFFFFF
#define HANDLE_REMOTE_SHIFT 24


struct metanet_context;

uint32_t metanet_handle_register(struct metanet_context *ctx);
struct metanet_context *metanet_handle_grab(uint32_t handle);
int metanet_handle_retire(uint32_t handle);
void metanet_handle_retireall();

uint32_t metanet_handle_findname(const char *name);
const char *metanet_handle_namehandle(uint32_t handle, const char *name);

void metanet_handle_init(int harbor);
void metanet_handle_exit();

#endif // !METANET_HANDLE_H